package nju.software.tagmanager.common.helper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * @author: raychou
 * @date: 2023-11-25 16:00
 * @description:
 */
@Component
public class SpringEnvHelper {
    @Autowired
    private Environment environment;

    public boolean isProdEnvironment() {
        String activeProfile = environment.getProperty("spring.profiles.active");
        return "prod".equals(activeProfile);
    }

    public boolean isDevEnvironment() {
        String activeProfile = environment.getProperty("spring.profiles.active");
        return "dev".equals(activeProfile);
    }
}
